package meterMonitor.biz;

import meterMonitor.mapper.MeterMapper;
import meterMonitor.model.Meter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by admin on 2019/1/3.
 */
@Service
public class MeterBiz extends  BaseBiz {

    @Autowired
    private MeterMapper meterMapper;
   public List<Meter> queryMeter(Meter condition){
        return meterMapper.queryMeter(condition);
    }


    public void saveMeter(Meter meterMod){
        if(meterMod.getPkid()==null){
            this.meterMapper.insertSelective(meterMod);
        }else {
            this.meterMapper.updateByPrimaryKeySelective(meterMod);
        }
    }
}
